﻿using UnityEngine;
using UnityEngine.UI;

namespace UIExpand
{
    public class TextureChanger : MonoBehaviour
    {
        public Renderer re;
        public Texture[] texs;
        public string shaderProperty = "_MainTex";
        
        public void ChangeToIndex(int idx)
        {
            if (idx >= texs.Length || texs[idx] == null)
                return;

            re.material.SetTexture(shaderProperty, texs[idx]);
        }
    }
}

